<!--
 * @Descripttion: 
 * @version: 
 * @Author: Jun
 * @Date: 2021-05-25 16:57:46
 * @LastEditors: Jun
 * @LastEditTime: 2021-06-04 10:39:54
-->
<template>
  <el-input 
    placeholder="请输入内容" 
    :value="value" 
    @input="inputHandler" 
    :disabled="isDisabled" 
    :type="type"
    class="input"></el-input>
</template>

<script>
export default {
    props:{
        data:{//输入的内容
            type:String,
            required:true
        },
        isDisabled:{//是否禁用
            type:Boolean,
            default:false
        },
        type:{//输入框类型
            type:String,
            default:"text"
        }
    },
    model:{
        prop:"data",
        event:"change"
    },
    data(){
        return{
            value:this.data//输入内容
        }
    },
    methods:{
        inputHandler(value){
            this.value = value
            this.$emit("change",this.value)
        }
    }
}
</script>

<style lang="scss" scoped>
.input{
    /deep/ textarea{
        resize: none;
    }
}
</style>
